(function() {	
	Wallet.widget.DashBoardPanel = function(el, config) {
		var width = Dom.getViewportWidth(),
		height = Dom.getViewportHeight();
		
		Wallet.lang.applyIf(config, {
			x: (width - 800) / 2,
			width: "800px",
			fixedCenter: false,
			close: false,
			draggable: false
		});
		
		Wallet.widget.DashBoardPanel.superclass.constructor.call(this, el, config);	
	};
	
	var Lang = YAHOO.lang,
		Dom = YAHOO.util.Dom,
		Panel = YAHOO.widget.Panel
		TabView = YAHOO.widget.TabView,
		DashBoardPanel = Wallet.widget.DashBoardPanel,
		DashBoardTabView = Wallet.widget.DashBoardTabView;
	
	var DEFAULT_CONFIG = {
		"TABVIEW": {
			key: "tabView", 
			value: null,
            //validator: Lang.isNumber, 
            suppressEvent: true, 
            supercedes: ["iframe"]
		}
	};
	
	Lang.extend(DashBoardPanel, Panel, {
		init: function(el, userConfig) {
			DashBoardPanel.superclass.init.call(this, el);
			
			this.beforeInitEvent.fire(DashBoardPanel);
            
            if (userConfig) {
                this.cfg.applyConfig(userConfig, true);
            }
            
            this.initEvent.fire(DashBoardPanel);			
		},
		initDefaultConfig: function() {
			DashBoardPanel.superclass.initDefaultConfig.call(this);
			
			this.cfg.addProperty(DEFAULT_CONFIG.TABVIEW.key, {            
                handler: this.configTabView,
                value: DEFAULT_CONFIG.TABVIEW.value, 
                //validator: DEFAULT_CONFIG.TABVIEW.validator, 
                supercedes: DEFAULT_CONFIG.TABVIEW.supercedes
            });
		},
		configTabView: function(type, args, obj) {
			var tabView = args[0];
			
			if (tabView) {
				var dashBoardTabView;
				
				if (Lang.isString(tabView)) {
					dashBoardTabView = new DashBoardTabView(tabView);	
				} else if (Lang.isObject(tabView)) {
					dashBoardTabView = new DashBoardTabView(tabView.el, tabView);
				}
				
				this.tabView = dashBoardTabView;
			}
		}
	});
}());